package com.gzs.learn.admin.mapper;

import com.gzs.learn.admin.IntegrationBaseTest;
import com.gzs.learn.admin.model.po.DbConfig;
import com.gzs.learn.inf.enums.StatusEnums;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;

import java.util.Date;

/**
 * date:  2023/4/9
 * author:guanzhisong
 */
class DbConfigMapperTest extends IntegrationBaseTest {

    @Test
    void should_save_db_config_success() {
        DbConfig config = DbConfig.builder()
                .url("jdbc")
                .dbschema("test")
                .dbuser("dbuser")
                .pwd("pwd")
                .status(StatusEnums.ENABLE.getCode())
                .createTime(new Date())
                .build();
        int row = dbConfigMapper.insertDbConfig(config);
        Assertions.assertThat(row == 1);
    }

}
